<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">

    <link rel="stylesheet"href="${pageContext.request.contextPath}/css/release.css">
    <script src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/companyIndex.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/recruit.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/companyHead.css">
    <title>发布招聘信息</title>

</head>
<body>
<%--导航--%>
<jsp:include page="../companyHead.jsp"></jsp:include>
<!--主要填写招聘信息模块-->
<div class="container">
    <!--进展条-->
    <div class="processbar">
        <div>
            <span class="circular">
            <span class="numdot_cotent enterprise">

                <span>1</span>
            </span>
         </span>
            <span class="process_text">职位信息填写</span>
            <span class="dotline">
                <div class="line">

                </div>
            </span>
            <span class="assintspan"></span>
            <span class="circular active-false">
                <span class="numdot_cotent enterprise">

                    <span>2</span>
                </span>
            </span>
            <span class="process_text active-false">职位发布完成</span>
            <span class="dotline active-false">
                <div class="line">

                </div>
            </span>

        </div>
    </div>
    <div class="show-true">
        <!--招聘详细信息-->
        <div class="brick">
            <div class="ant-row section"style="margin: 20px 0px 30px;">
                <div class="ant-col-23 ant-col-offset-1">
                    <h1 class="title">职位信息</h1>
                </div>
            </div>
            <!--职位名称-***********************-->
            <form  class="layui-form" action ="${pageContext.request.contextPath}/recruit/add" method="post" style="height: 500px">
                <div class="type"style="margin-bottom:20px ">
                    <label style="margin-left: 130px">职位名称:</label>
                    <input type="text" placeholder="请输入职位名称" name="recName" class="jobname" onblur="check_jobname()" style="width: 350px;"/>
                    <span class="input_tip"style="color: red"></span><br>
                </div>

                <div class="type"style="margin-bottom:20px ">
                    <label style="margin-left: 130px">招聘人数:</label>
                    <input type="text" placeholder="请输入招聘人数" name="recPerNum" class="jobneednum" onblur="check_jobneednum()" style="width: 350px;"/>人
                    <span class="input_tip"style="color: red"></span><br>
                </div>
                <div class="type"style="-margin-bottom:20px ">
                    <label style="margin-left: 130px">每月薪资:</label>
                    <input type="text" placeholder="薪资" name="recJobSalary" id="max" onblur="check_Salary()" style="width:200px;"/>元

                    <span class="input_tip"style="color: red"></span><br>
                </div>
                <div class="layui-form-item">
                    <div class="WorkAddress"style="margin-top:20px ">
                        <label style="margin-left: 130px">工作地址:</label>
                        <input type="text" placeholder="请输入工作地址" name="recJobAddress" class="WorkAddress" onblur="check_WorkAddress()" style="width: 350px;"/>
                        <span class="input_tip"style="color: red"></span><br>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="KeyWord"style="margin-bottom:20px ">
                        <label style="margin-left: 130px">关键文字:</label>
                        <input type="text" placeholder="请输入招聘职位关键字" name="kwd" class="KeyWord" onblur="check_KeyWord()" style="width: 350px;"/>
                        <span class="input_tip"style="color: red"></span><br>
                    </div>
                </div>
                <!--职位福利-->



                <div class="layui-form-item">
                    <div class="KeyWord"style="margin-bottom:20px ">
                        <label style="margin-left: 130px">学历要求:</label>
                        <input type="text" placeholder="请输入招聘职位关键字" name="education" class="study" onblur="check_KeyWord()" style="width: 350px;"/>
                        <span class="input_tip"style="color: red"></span><br>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="KeyWord"style="margin-bottom:20px ">
                        <label style="margin-left: 130px">工作经历:</label>
                        <input type="text" placeholder="请输入招聘职位关键字" name="recJobExperience" class="experience" onblur="check_KeyWord()" style="width: 350px;"/>
                        <span class="input_tip"style="color: red"></span><br>
                    </div>
                </div>

                <div class="positiondescribe"style="margin-bottom:20px ">
                    <div class="layui-form-item layui-form-text"style="width: 1000px;">
                        <label style="margin-left: 105px">职位要求：</label>
                        <div class="layui-input-block"style="margin-left: 200px;height:200px">
                            <textarea name="jobIntroduction" placeholder="请描述具体职位要求" class="layui-textarea"></textarea>
                        </div>

                    </div>

                </div>
                <%--  <button type="submit" class="layui-btn">保存</button>--%>
                <button type="reset" class="layui-btn layui-btn-primary"style="margin-left: 200px">重置</button>
                <input style="height: 38px;width: 65.6px;margin-top: -1px;" type="submit" value="保存"/>

            </form>

            <script>

            </script>
            <script>
                function check_KeyWord(){
                    var flag =false;
                    var KeyWordElement = document.querySelector("input[name='KeyWord']");//获得用户名元素控件<input />
                    var KeyWord = KeyWordElement.value;  //获得用户名的值
                    console.log(KeyWord);
                    var KeyWord_tip= KeyWordElement.nextElementSibling;


                    if( !/^[\u4e00-\u9fa5]{0,}$/.test(KeyWord)  ){
                        KeyWord_tip.innerText="职位名称必须是汉字组成且不能为空"
                    } else{
                        KeyWord_tip.innerText="";
                        flag = true;
                    }
                    return flag;
                }
                function check_jobname(){
                    var flag =false;
                    var jobnameElement = document.querySelector("input[name='jobname']");//获得用户名元素控件<input />
                    var jobname = jobnameElement.value;  //获得用户名的值
                    console.log(jobname);
                    var jobname_tip= jobnameElement.nextElementSibling;


                    if(jobname == null || jobname ==""){
                        jobname_tip.innerText="职位名称必填";
                    }else if( !/^[\u4e00-\u9fa5]{0,}$/.test(jobname)  ){
                        jobname_tip.innerText="职位名称必须是汉字组成且不能为空"
                    } else{
                        jobname_tip.innerText="";
                        flag = true;
                    }
                    return flag;
                }

                function check_jobneednum(){
                    var flag =false;
                    var jobneednumElement = document.querySelector("input[name='jobneednum']");//获得用户名元素控件<input />
                    var jobneednum = jobneednumElement.value;  //获得用户名的值
                    console.log(jobneednum);
                    var jobneednum_tip= jobneednumElement.nextElementSibling;


                    if(jobneednum == null || jobneednum ==""){
                        jobneednum_tip.innerText="必填";
                    }else if( !/^[1-99]*$/.test(jobneednum)  ){
                        jobneednum_tip.innerText="招聘人数在1-99之间"
                    } else{
                        jobneednum_tip.innerText="";
                        flag = true;
                    }
                    return flag;
                }
                /*                function check_Salary(){
                                    var flag =false;
                                    var SalaryElement = document.querySelector("input[name='Salary']");//获得用户名元素控件<input />
                                    var Salary = SalaryElement.value;       //获得用户名的值
                                    console.log(Salary);
                                    var Salary_tip= SalaryElement.nextElementSibling;


                                    if(Salary == null || Salary ==""){
                                        Salary_tip.innerText="必填";
                                    }else if( !/^[1000-9999]*$/.test(Salary)  ){
                                        Salary_tip.innerText="输入工资需求"
                                    } else{
                                        Salary_tip.innerText="";
                                        flag = true;
                                    }
                                    return flag;
                                }*/


                function check_WorkAddress(){
                    var flag =false;
                    var WorkAddressElement = document.querySelector("input[name='WorkAddress']");//获得用户名元素控件<input />
                    var WorkAddress = WorkAddressElement.value;  //获得用户名的值
                    console.log(WorkAddress);
                    var WorkAddress_tip= WorkAddressElement.nextElementSibling;


                    if(WorkAddress == null || WorkAddress ==""){
                        WorkAddress_tip.innerText="工作地址必填";
                    } else{
                        WorkAddress_tip.innerText="";
                        flag = true;
                    }
                    return flag;
                }

            </script>

        </div>
    </div>
</div>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });



</script>

</body>
</html>